package com.heg.bk.control;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.heg.bk.service.SmsManagerService;
import com.comm.util.pages.PageUtils;

/**
 * 短信管理控制层
 * @author dengxuzhao
 * @time 2016-05-01
 */
@RequestMapping(value = "/hegbk/sms")
@Controller("smsManagerAction")
public class SmsManagerAction {
	
	@Resource
	private SmsManagerService smsService;
	
	/**
	 * 短信列表
	 * @param model
	 * @param smsstataus 短信状态
	 * @param type 类型
	 * @param startTime 查询开始时间
	 * @param endTime 查询截止时间
	 * @param currPage 当前页码
	 * @param pageSize 页容量
	 * @return
	 */
	@RequestMapping(value = "/smslst", method = {RequestMethod.POST, RequestMethod.GET})
	public String lst_mobileUser(Model model, 
			@RequestParam(value = "smsstataus", required = false) String smsstataus,
			@RequestParam(value = "type", required = false) String type,
			@RequestParam(value = "startTime", required = false) String startTime,
			@RequestParam(value = "endTime", required = false) String endTime,
			@RequestParam(value = "currPage", required = false) String currPage,
			@RequestParam(value = "pageSize", required = false) String pageSize){
		Integer recordCount = smsService.select_smsToRecord(null, null);
		PageUtils pageUtils =  smsService.select_smsToPage(null, null, 1, 15, recordCount);
		model.addAttribute("pageUtils", pageUtils);
		return "html/bk-content/content-sms";
	}

}
